package com.sen.rbac.feign.fallback;

import com.sen.common.common.response.MessageResult;
import com.sen.common.common.response.ResultMsgEnum;
import com.sen.rbac.feign.RbacEntityTypeFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author esjiang
 */
@Component
public class RbacEntityTypeFeignFallbackFactory implements FallbackFactory<RbacEntityTypeFeign> {
    @Override
    public RbacEntityTypeFeign create(Throwable cause) {
        return new RbacEntityTypeFeign() {
            @Override
            public MessageResult syncEntityTypeRoles(String entityCode, String entityTypeCodes) {
                return MessageResult.reqFailed(ResultMsgEnum.SERVICE_EXCEPTION);
            }
        };
    }
}
